﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DSTMEETING.BLL
{
    public class DSTDbContext : DbContext
    {
        public DSTDbContext()
            : base("name=dstmeeing-db")
        {
            Database.SetInitializer<DSTDbContext>(null);
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            // 将实体与表关联
            modelBuilder.Entity<Entity.Meeting>().ToTable("DST_Meeting");
            modelBuilder.Entity<Entity.Meeting>().HasKey(p => p.Id);

            base.OnModelCreating(modelBuilder);
        }
    }
}
